package com.hqyj.crmdemo.mapper;

import com.hqyj.crmdemo.entity.CustmerName;
import com.hqyj.crmdemo.entity.Orders;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author 何万林
 * @since 2022-10-17
 */
public interface OrdersMapper extends BaseMapper<Orders> {
@Select("SELECT custmer_name,custmer_manager from custmer,\n" +
        "(select u_name from orders LEFT JOIN  user on orders.u_id=user.u_id where  DATE_ADD(orders_date,INTERVAL 180 DAY)<NOW())temp \n" +
        " where custmer.custmer_name=temp.u_name ")
    List<CustmerName> selectName();
}
